package com.example.shop.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.shop.entity.SearchShopCondition;
import com.example.shop.entity.Shop;
import com.example.shop.mapper.ShopMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ShopService {

    @Autowired
    private ShopMapper mapper;

    @Transactional
    public void insert(Shop shop) {
        mapper.insert(shop);
    }

    @Transactional
    public void delete(int id) {
        mapper.deleteById(id);
    }

    public Page<Shop> search(SearchShopCondition condition) {
        return mapper.search(condition);
    }

    public List<Shop> search(List<String> contSignList) {
        return mapper.search(contSignList);
    }

}
